/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package RPS;

import SPARQL.SPARQL;
import java.util.Objects;

/**
 *
 * @author mirko
 */
public class MappingAssertion {
    
    private SPARQL body;
    private SPARQL head;

    public MappingAssertion(SPARQL body, SPARQL head) {
        this.body = body;
        this.head = head;
    }
    
    

    /**
     * @return the body
     */
    public SPARQL getBody() {
        return body;
    }

    /**
     * @param body the body to set
     */
    public void setBody(SPARQL body) {
        this.body = body;
    }

    /**
     * @return the head
     */
    public SPARQL getHead() {
        return head;
    }

    /**
     * @param head the head to set
     */
    public void setHead(SPARQL head) {
        this.head = head;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 23 * hash + Objects.hashCode(this.body);
        hash = 23 * hash + Objects.hashCode(this.head);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final MappingAssertion other = (MappingAssertion) obj;
        if (!Objects.equals(this.body, other.body)) {
            return false;
        }
        if (!Objects.equals(this.head, other.head)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return body + " -> \n" + head ;
    }

    @Override
    public Object clone(){
        SPARQL head, body;
        head = (SPARQL) this.getHead().clone();
        body = (SPARQL) this.getBody().clone();
        MappingAssertion newMapping = new MappingAssertion(body, head);
        
        return newMapping;
        
    }
    

    
    
}
